package edu.szu.huhanpeng.doodlingFight.view 
{
	import com.bit101.components.Window;
	import edu.szu.huhanpeng.doodlingFight.view.components.PlayerWindow;
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.patterns.mediator.Mediator;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class PlayerWindowMed extends Mediator implements IMediator, INotifier 
	{
		
		public static const P_ONE_NAME:String = "pOneName";
		public static const P_TWO_NAME:String = "pTwoName";
		
		private static const LIGHT_COLOR:int = 0xE11723;
		private static const DARK_COLOR:int = 0x623C4B;
		
		
		public function PlayerWindowMed( mediatorName:String, viewComponent:Object ) 
		{
			super( mediatorName, viewComponent );
		}
		
		public function setName(str:String):void
		{
			window.setPlayerName( str );
		}
		
		public function setScore(score:int):void
		{
			window.setScore( score );
		}
		
		public function light():void
		{
			window.color = LIGHT_COLOR;
		}
		
		public function dark():void
		{
			window.color = DARK_COLOR;
		}
		
		protected function get window():PlayerWindow
		{
			return viewComponent as PlayerWindow;
		}
	}

}